using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace AnimationPage.Converters;

public sealed class BoolConverters : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (value is not bool result)
            return false;

        if (parameter == null)
            return !result;

        return result;
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}